﻿<Page x:Class="CAION2.Views.ManastonePage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:classes="clr-namespace:CAION2.Classes"
      xmlns:mui="clr-namespace:FirstFloor.ModernUI.Windows.Controls;assembly=FirstFloor.ModernUI"
      xmlns:resources="clr-namespace:CAION2.Properties"
      xmlns:viewModels="clr-namespace:CAION2.ViewModels"
      FontFamily="/Fonts/Marmelad-Regular.ttf#Marmelad">

    <Page.Resources>
        <viewModels:ItemTypeColorConverter x:Key="ItemTypeColor" />
    </Page.Resources>

    <Page.DataContext>
        <viewModels:ManastonesDialogViewModel />
    </Page.DataContext>

    <Grid Style="{StaticResource ContentRoot}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel Grid.ColumnSpan="2"
                    Margin="0,0,0,0"
                    Orientation="Horizontal">

            <Image Width="40"
                   Height="40"
                   Source="{Binding CurrentManaStone.Icon}"
                   Stretch="Uniform" />

            <TextBlock Grid.Column="1"
                       Margin="20,0,0,0"
                       VerticalAlignment="Center"
                       FontSize="16"
                       Text="{Binding CurrentManaStone.Translate}"
                       TextWrapping="Wrap" />
        </StackPanel>

        <StackPanel Grid.Row="0" Grid.Column="1"
                    Margin="0,0,0,20"
                    HorizontalAlignment="Right"
                    Orientation="Horizontal">
            <mui:ModernButton Margin="0,0,10,0"
                              Command="{Binding CopyManaStoneCommand}"
                              IconData="{StaticResource CopyIcon}"
                              ToolTip="{x:Static resources:Resources.Manastones_MenuCopy}" />
            <mui:ModernButton Command="{Binding DeleteManaStoneCommand}"
                              IconData="{StaticResource ClearIcon}"
                              ToolTip="{x:Static resources:Resources.Manastones_MenuDelete}" />
        </StackPanel>

        <StackPanel Grid.Row="1"
                    Grid.Column="1"
                    HorizontalAlignment="Right"
                    Orientation="Horizontal">
            <RadioButton Margin="7,0"
                         ClickMode="Press"
                         Command="{Binding ShowManastonesOfLevelCommand}"
                         CommandParameter="20"
                         Content="10-20"
                         Visibility="{Binding LevelVisible[0]}" />
            <RadioButton Margin="7,0"
                         Command="{Binding ShowManastonesOfLevelCommand}"
                         CommandParameter="30"
                         Content="30"
                         Visibility="{Binding LevelVisible[1]}" />
            <RadioButton Margin="7,0"
                         Command="{Binding ShowManastonesOfLevelCommand}"
                         CommandParameter="40"
                         Content="40"
                         Visibility="{Binding LevelVisible[2]}" />
            <RadioButton Margin="7,0"
                         Command="{Binding ShowManastonesOfLevelCommand}"
                         CommandParameter="50"
                         Content="50"
                         Visibility="{Binding LevelVisible[3]}" />
            <RadioButton Margin="7,0"
                         Command="{Binding ShowManastonesOfLevelCommand}"
                         CommandParameter="60"
                         Content="60"
                         Visibility="{Binding LevelVisible[4]}" />
            <RadioButton Margin="7,0"
                         Command="{Binding ShowManastonesOfLevelCommand}"
                         CommandParameter="70"
                         Content="70"
                         Visibility="{Binding LevelVisible[5]}" />
        </StackPanel>


        <StackPanel Grid.Row="2" Grid.Column="0" Orientation="Vertical">

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="maxHP"
                         Content="{x:Static resources:Resources._StatsMaxHP}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="maxMP"
                         Content="{x:Static resources:Resources._StatsMaxMP}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="phyattack"
                         Content="{x:Static resources:Resources._StatsPhyAttack}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="hitAccuracy"
                         Content="{x:Static resources:Resources._StatsAccuracy}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="block"
                         Content="{x:Static resources:Resources._StatsBlock}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="dodge"
                         Content="{x:Static resources:Resources._StatsDodge}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="magicalhitAccuracy"
                         Content="{x:Static resources:Resources._StatsMagicalHitAccuracy}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="MagicalResist"
                         Content="{x:Static resources:Resources._StatsMagicalResist}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="magicalskillboost"
                         Content="{x:Static resources:Resources._StatsMagicalSkillBoost}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="parry"
                         Content="{x:Static resources:Resources._StatsParry}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="critical"
                         Content="{x:Static resources:Resources._StatsCritical}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="maxFP"
                         Content="{x:Static resources:Resources._StatsMaxFP}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="healskillboost"
                         Content="{x:Static resources:Resources._StatsHealSkillBoost}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="magicalCritical"
                         Content="{x:Static resources:Resources._StatsCritSpell}" />

            <RadioButton Margin="0,1"
                         Command="{Binding ShowManastonesOfTypeCommand}"
                         CommandParameter="magicalCriticalReduceRate"
                         Content="{x:Static resources:Resources._StatsMagicalCritResist}" />
        </StackPanel>

        <ListBox Grid.Row="2"
                 Grid.Column="1"
                 Width="640"
                 Margin="10,0,0,0"
                 HorizontalAlignment="Stretch"
                 VerticalAlignment="Stretch"
                 VerticalContentAlignment="Stretch"
                 IsSynchronizedWithCurrentItem="True"
                 ItemsSource="{Binding Manastones}"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 ScrollViewer.VerticalScrollBarVisibility="Disabled"
                 SelectedItem="{Binding SelectedManaStone,
                                        Mode=TwoWay,
                                        UpdateSourceTrigger=PropertyChanged}">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Orientation="Horizontal" ScrollViewer.VerticalScrollBarVisibility="Auto" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate DataType="{x:Type classes:ManaStone}">
                    <StackPanel Height="28"
                                Margin="0,4"
                                Orientation="Horizontal">
                        <Image Width="28"
                               Height="28"
                               VerticalAlignment="Center"
                               Source="{Binding Icon}"
                               Stretch="Uniform" />
                        <TextBlock Width="150"
                                   Margin="5,0,0,0"
                                   VerticalAlignment="Center"
                                   Foreground="{Binding Row[Quality],
                                                        Converter={StaticResource ItemTypeColor}}"
                                   Text="{Binding Translate}"
                                   TextWrapping="Wrap" >
                            <TextBlock.Effect>
                                <DropShadowEffect BlurRadius="1"
                                          Direction="315"
                                          Opacity="0.5"
                                          ShadowDepth="1"
                                          Color="Black" />
                            </TextBlock.Effect>
                        </TextBlock>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

    </Grid>

</Page>
